﻿using System.ComponentModel.DataAnnotations;

namespace WH.Contracts.Systems.Roles
{
    /// <summary>
    /// 角色
    /// </summary>
    public class RoleInputDto
    {
        ///// <summary>
        ///// 父节点id 默认为0位顶节点
        ///// </summary>
        //public string? ParentId { get; set; }

        /// <summary>
        /// 编号
        /// </summary>
        [Required(ErrorMessage = "角色编号不能为空")]
        [MaxLength(50, ErrorMessage = "角色编号最大长度为50")]
        public string Code { get; set; } = null!;

        /// <summary>
        /// 名称
        /// </summary>
        [Required(ErrorMessage = "角色名称不能为空")]
        [MaxLength(50, ErrorMessage = "角色名称最大长度为50")]
        public string Name { get; set; } = null!;

        /// <summary>
        /// 描述
        /// </summary>
        [MaxLength(50, ErrorMessage = "角色描述最大长度为50")]
        public string? Description { get; set; }

        /// <summary>
        /// 角色类型
        /// </summary>
        [Required(ErrorMessage = "角色类型不能为空")]
        [MaxLength(50, ErrorMessage = "角色类型最大长度为50")]
        public string TypeCode { get; set; } = null!;

        /// <summary>
        /// 机构ID
        /// </summary>
        [Required(ErrorMessage = "机构Id不能为空")]
        [MaxLength(50, ErrorMessage = "机构Id最大长度为50")]
        public string OrganizationId { get; set; } = null!;

        /// <summary>
        /// 状态（0停用 1正常）
        /// </summary>
        public bool IsEnable { get; set; }

        /// <summary>
        /// 排序码 数字越小越靠前
        /// </summary>
        public int SortCode { get; set; }

        /// <summary>
        /// 描述/备注说明
        /// </summary>
        [MaxLength(255, ErrorMessage = "描述/备注说明最大长度为255")]
        public string? Remark { get; set; }

        /// <summary>
        /// 资源Id
        /// </summary>
        public string[]? ResourceIds { get; set; }

        /// <summary>
        /// 地图区域权限ids
        /// </summary>
        public string[]? MapIds { get; set; }

        /// <summary>
        /// 告警类型权限codes
        /// </summary>
        public string[]? WarnTypeCodes { get; set; }
    }
}
